Release 10.1A: OpenEdge Development:
Programming Interfaces
Error handling
When a Progress SAX application parses an XML document, it might encounter one of three distinct parse-related error situations. They are:
SAX-PARSE(),SAX-PARSE-FIRST(), orSAX-PARSE-NEXT()detects an error and cannot complete its current parse operation.This might be caused by one of the following:
- The specified XML source does not exist.
- The handle to the procedure containing the callbacks is invalid.
SAX-readerwas not in the appropriate state. This can happen, for example, ifSAX-PARSE-NEXT()was called beforeSAX-PARSE-FIRST().If this error situation occurs:
- Parsing stops.
- Progress raises an error.
If
NO-ERRORwas specified, Progress setsERROR-STATUS:ERRORtoYES, setsERROR-STATUS:NUM-MESSAGESto the number of errors encountered, and returns a Progress error message in response to a statement with the following syntax:
where
err-msg-numindicates a number between 1 andERROR-STATUS:NUM-MESSAGESinclusive.If
NO-ERRORwas not specified, Progress looks in the driver routine for the closest block that has the error property and behaves as if the block has an explicitONERRORphrase.- A callback raises an error by using the
RETURNstatement’sERRORoption.If this error situation occurs:
- Parsing stops.
- Progress raises an error.
If
NO-ERRORwas specified, Progress setsERROR-STATUS:ERRORtoYESand setsERROR-STATUS:NUM-MESSAGESto zero.If
NO-ERRORwas not specified, Progress looks in the driver routine for the closest block that has the error property and behaves as if the block has an explicitONERRORphrase.Note: If a callback procedure calls a second procedure, the second procedure calls a third procedure, etc., and the final procedure in the chain executesRETURN-VALUEis set to whatever string theRETURNstatement included.RETURNERROR, each preceding procedure in the chain must also executeRETURNERROR, else the error condition is never communicated to the driver routine. This is standard Progress behavior.- While a callback is executing, Progress raises an error that the callback does not handle—for example, a
FINDCUSTOMERthat fails to find the specified customer.If this error situation occurs:
- The error is displayed (which is standard Progress behavior).
- In the callback, Progress finds the closest block that has the error property (which might be the
PROCEDUREblock) and behaves according to the block’s explicit or implicitONERRORphrase. This might cause Progress to break out of the callback.- The
PARSE-STATUSattribute and theERROR-STATUShandle are unaffected.- The parse continues.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |